package com.example.composeplayground.common

import androidx.activity.ComponentActivity
import com.blankj.utilcode.util.ActivityUtils

object TokenUtils {
    fun setToken(token: String) {
        ActivityUtils.getTopActivity()
            .getSharedPreferences("user", ComponentActivity.MODE_PRIVATE).edit()
            ?.putString("token", token)?.apply()
    }

    fun getToken(): String? {
        return ActivityUtils.getTopActivity()
            .getSharedPreferences("user", ComponentActivity.MODE_PRIVATE).getString("token", null)
    }
}